<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试支付</title>
    <script src="jquery-2.1.4.min.js"></script>
    <script>
        function pay(){
             //获取订单id
            var oid = $("#oid").val();
            var oname = $("#oname").val();
            var money = $("#money").val();
            var desc = $("#desc").val();
            $.post("pay",{oid:oid,oname:oname,money:money,desc:desc},function(data){
                console.info(data);
                if(data.success==1){
                   $("#div").append(data.target);
                }else{
                    alert(data.error);
                }
            });


        }
    </script>
</head>
<body>
     <div id="div">
     </div>

      <form action="pay" method="post">
            订单id<input type="text" id="oid" name="oid" />
            订单名称<input type="text" id="oname" name="oname" />
            付款金额<input type="text" id="money" name="money" />
            描述<input type="text" id="desc" name="desc" />
          <input type="button" value="付款" onclick="pay()">
      </form>
</body>
</html>